<?php 
	/**
	 * __call()方法
	 */

	class Person {
			public $name = "";
			public $age  = 18;
			public $sex  = "男";
			public $marr = array(
				"aaa",
				"bbb",
				"ccc",
				"ddd"
			);

			public function __construct($name, $age, $sex) {
				$this->name = $name;
				$this->age  = $age;
				$this->sex  = $sex;
			}

			public function say() {
				echo "我叫".$this->name;
			}

			public function __toString() {
				echo "Hello!!!";
			}

			public function __call($method, $args) {
				if (in_array($method, $this->marr)) {
					echo $args[0]."<br>";
				}else{
					echo "你调用的方法{$method}()不存在！<br>";
				}

				/*echo "对不起！你调用的方法{$method}(),参数为";
				print_r($args);
				echo "不存在！<br>";*/
			}
		}

	$p1 = new Person("张三", 20, "男");
	echo $p1->say();

	echo $p1->run("pao");
	echo "<br>";

	$p1 -> aaa("------1------");
	$p1 -> bbb("------2------");
	$p1 -> ccc("------3------");
	$p1 -> ddd("------4------");
	$p1 -> mmm("------5------");











 ?>